#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<cstdio>

using namespace std;

int main()
{
    long long N, n, y, r;
    cin >> N;
    n = N / 365;
    y = N % 365 / 30;
    r = N - 365 * n - y * 30;
    cout << n << " ano(s)" << endl;
    cout << y << " mes(es)" << endl;
    cout << r << " dia(s)" << endl;
    return 0;
}